package com.digital.welcome.controller;

import com.digital.welcome.service.UserCommunicationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user-communication")
public class UserCommunicationController {
    @Autowired
    private UserCommunicationService userCommunicationService;

    @ApiOperation("获取我的高年级同学ID")
    @RequestMapping(value = "/get-sophomore", method = RequestMethod.GET)
    public String getSophomore(@RequestParam(value = "userName") String userName) {
        return userCommunicationService.getIdSophomoreByUserName(userName);
    }
    @ApiOperation("获取我的新同学ID")
    @RequestMapping(value = "/get-freshman", method = RequestMethod.GET)
    public String getFreshman(@RequestParam(value = "userName") String userName) {
        return userCommunicationService.getIdFreshmanByUserName(userName);
    }

    @ApiOperation("获取交流Id")
    @RequestMapping(value = "/getId", method = RequestMethod.GET)
    public String getIdByUserName(@RequestParam(value = "userName") String userName) {
        return userCommunicationService.getIdByUserName(userName);
    }
}
